package org.zhadoop.stream.cql.tasks;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zhadoop.stream.cql.CQLResult;
import org.zhadoop.stream.cql.DriverContext;
import org.zhadoop.stream.cql.exception.CQLException;
import org.zhadoop.stream.cql.hooks.SemanticAnalyzeHook;
import org.zhadoop.stream.cql.semanticanalyzer.parser.context.ParseContext;
import org.zhadoop.streaming.config.StreamingConfig;


/**
 * 一些延迟的任务处理
 * @author zwd
 *
 */
public class LazyTask extends BaseTask {

	private static final Logger LOG = LoggerFactory.getLogger(LazyTask.class);
	
	private DriverContext context;
	
	@Override
	public void init(DriverContext driverContext, StreamingConfig config, List<SemanticAnalyzeHook> analyzeHooks)
			throws CQLException {
		super.init(driverContext, config, analyzeHooks);
		this.context = driverContext;
	}

	@Override
	public void execute(ParseContext parseContext) throws CQLException {
		LOG.info("start to execute " + parseContext.toString());
		context.addParseContext(parseContext);
	}

	@Override
	public CQLResult getResult() {
		return null;
	}

}
